package com.jiyun.controller;

import com.jiyun.pojo.ThComplaint;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.jiyun.service.IThComplaintService;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  客户投诉表
 * </p>
 *
 * @author usian
 * @since 2022-10-26
 */
@RestController
@RequestMapping("/complaint")
@Api(tags = "接口")
@CrossOrigin
public class ThComplaintController{

    @Autowired
    private IThComplaintService thComplaintService;

    /**
     * 添加客诉
     */
    @PostMapping("/ks")
    public String addKs(@RequestBody ThComplaint complaint){

        boolean add = thComplaintService.add(complaint);
        if (add){
            return "新增客诉成功";
        }else {
            return "新增客诉失败";
        }
    }
}
